﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Controls_HomeMenu : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Int16 cat =Convert.ToInt16( Request.QueryString["cat"]);
        ArrayList lMenu = new ArrayList();
        lMenu.Add( new CMenu(0, "Houses"));
        lMenu.Add( new CMenu(4, "Cars"));
        lMenu.Add( new CMenu(5, "Jobs"));
        lMenu.Add( new CMenu(6, "Others"));
        foreach( CMenu c in lMenu)
        {
            if (c.Id == cat)
            {
                c.Active = true;
                c.cssClass = "active";
            }
            else
                c.Active = false;               
        }
        Repeater1.DataSource = lMenu;
        Repeater1.DataBind();
       
    }
}
public class CMenu {     
    public int Id { get; set; }
    public string Name { get; set; }
    public bool Active { get; set; }
    public string cssClass { get; set; }
    public  CMenu(int id, string name)
    {
        this.Id = id;
        this.Name = name;
    }
}
